﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="alunoGrupo.List" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>
<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Web.UI.WebControls" tagprefix="asp" %>

<%@ Register assembly="Catalyst.Web.DynamicData" namespace="Catalyst.Web.DynamicData" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />

    <h2>Lista de alunos do grupo</h2>

    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />



    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        
            <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />

            
            <asp:GridView ID="GridView1" Runat="server" CssClass="gridview" 
                AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false" 
                OnPageIndexChanging="GridView1_PageIndexChanging" OnRowDataBound="RowDataBound"
                DataKeyNames="codigoAlunoGrupo">
          

            <Columns>

            <asp:BoundField HeaderText="" DataField="codigoAlunoGrupo" Visible=false>
            
            </asp:BoundField>
            
            <asp:BoundField HeaderText="Grupo" DataField="nomeGrupo"  ItemStyle-Width="250" >
            
                <ItemStyle Width="250px" />
            
            </asp:BoundField>
            
            <asp:BoundField HeaderText="Aluno" DataField="nomeAluno"  ItemStyle-Width="170" >
            
                <ItemStyle Width="170px" />
            
            </asp:BoundField>
            
                       <asp:TemplateField HeaderText="Ações"  ItemStyle-Width="520" >                
                        
            </asp:TemplateField>
             
            </Columns>
            
                <PagerStyle CssClass="footer"/>        
                <PagerTemplate>
                    <asp:GridViewPager ID="GridViewPager1" runat="server" />
                </PagerTemplate>
                <EmptyDataTemplate>
                    Não existem alunos vinculados a esse grupo.
                </EmptyDataTemplate>



          </asp:GridView> 
          
             
          
            <br />
            <%string codigoUrl = Request["codigoGrupo"].ToString();%>
          
          <a href="<%=Convert.ToString(ConfigurationManager.AppSettings["url"])%>/alunoGrupos/Insert.aspx?codigoGrupo=<%=codigoUrl %>&erro=ok">Vincular novo aluno</img></a>
        <br />
        <br />
            
            
      
   
        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
